package cn.com.self.apis.files.service.impl;

import cn.com.self.apis.files.entity.Files;
import cn.com.self.apis.files.mapper.FilesMapper;
import cn.com.self.apis.files.service.IFilesService;
import cn.com.selfsoft.smartcity.core.service.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author shisonghua
 * @since 2020-05-29
 */
@Service
public class FilesServiceImpl extends BaseServiceImpl<Files, String> implements IFilesService {

    @Autowired
    private IFilesService filesService;

    @Override
    public void saveFile(Map<String, String> map) {
        Files files=new Files();
        files.setFilename(map.get("filename"));
        files.setFilename2(map.get("filename2"));
        files.setFilepath(map.get("filePath"));
        files.setFilesize(map.get("filesize"));
        files.setSuffix(map.get("suffix"));
        files.setFiletype(map.get("filetype"));
        files.setCreateDate(new Date());
        files.setUpdateDate(new Date());
        files=filesService.create(files);
        map.put("fileId",files.getId()+"");
    }

}
